|
|
|
|
|
|
|
Figure 12.17
Scaling an object at its lower left corner. |
|
|
|
|
|
|
|
|
identity transformation. The identity transformation matrix leaves any point's coordinates unchanged. |
|
|
|
|
|
|
|
|
You can use the identity matrix to initialize the parts of a transformation that you will not be modifying. To build a scaling matrix, for example, you can start with the identity matrix and then modify the X and Y scaling terms. |
|
|
|
|
|
|
|
|
The first of the subroutines that follow sets a transformation equal to the identity matrix. The next three routines use the identity matrix as the basis for creating simple translation, scaling, and rotation transformations. |
|
|
|
 |
|
|
|
|
' Create a 2-dimensional identity matrix. Public Sub m2Identity(M() As Single)
Dim i As Integer
Dim j As Integer
For i = 1 To 3
For j = 1 To 3
If i = j Then
M(i, j) = 1 |
|
|
|
|
|